# -*- coding: utf-8 -*-

__author__ = 'rsj217'

from django import forms


class PostContact(forms.Form):

    name = forms.CharField(
        label=u'姓名',
        max_length=30,
        help_text=u'请填写真实的姓名')

    phone = forms.CharField(
        label=u'手机号',
        max_length=11,
        help_text=u'请填写11位手机号码（选填）',
        required=False)

    email = forms.EmailField(
        label=u'电子邮件',
        max_length=40,
        help_text=u'请填写电子邮件（选填）',
        required=False)

    province = forms.CharField(
        label=u'省',
        max_length=10)

    city = forms.CharField(
        label=u'城市',
        max_length=10)

    district = forms.CharField(
        label=u'区',
        max_length=20)

    street = forms.CharField(
        label=u'街道',
        max_length=100,
        widget=forms.Textarea,
        help_text=u'请填写详细街道地址')

    postcode = forms.IntegerField(
        label=u'邮编',
        help_text=u'请输入6位数字的邮编',
        required=False)


class PostCategory(forms.Form):

    name = forms.CharField(
        label=u'分类名',
        max_length=30,
        help_text=u'请填写分类名')

    description = forms.CharField(
        label=u'分类描述',
        help_text=u'请填写分类描述（选填）',
        widget=forms.Textarea,
        required=False)


    def clean(self):

        print self.cleaned_data

        return self.cleaned_data



